#include <iostream>
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
using namespace std;

void handler(int signo)
{
    cout << "get a signo : " << signo << endl;
}

int main()
{
    signal(6, handler); 
    abort(); //即使6号信号被捕捉了，进程也会被abort直接终止掉!
    while(1)
    {
        cout << "I am running" << endl;
        sleep(1);
    }
    return 0;
}